package com.wy.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;


/**
 * 配置文件的存放位置有特殊要求！！！有以下三种方式：
 * 1.放到application.properties中
 * 2.放到application-xxx.properties中，需要在application.properties中激活xxx。spring.profiles.active=xxx
 * 3.放到自定义的properties中。需要加上@PropertySource("classpath:application-config.properties")来指定加载路径
 */
@Component
@Data
//@PropertySource("classpath:application-config.properties")
@ConfigurationProperties(prefix = "people")
public class XXConfig {
    private String name;
    private int age;
}
